// pages/my/index.js
let app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userTop: [ {
      name: '脑力对决',
      appid: 'wx041268bb60d928ec',
      path: 'pages/home/home',
      avatar: "http://bmobfile.twho.top/2020/04/12/4bfaf62d40b962ba806b30a07fa01c5c.jpeg",
    }, {
      name: '情侣故事',
      appid: 'wx828938c4c3bd721b',
      avatar: "http://bmobfile.twho.top/2020/04/12/93dc988440d6cfc980b3b7db939b4172.png",
    }, {
      name: '驾考知识',
      appid: 'wx61d9342821baf05f',
      path: 'pages/login/index',
      avatar: "http://bmobfile.twho.top/2020/04/12/b5f5680b40f26a3980e6e9c69a62591a.jpeg",
    }, {
      name: '你画我猜',
      appid: 'wx6889d1ba0be9e04f',
      path: "bei_nhwc/pages/index/index",
      avatar: "http://bmobfile.twho.top/2020/04/12/fb245ed9405c2a33805bf7b07c44bfdb.jpeg",
    }, {
      name: '猜成语',
      appid: 'wxc97bec7ef17870bb',
      avatar: "http://bmobfile.twho.top/2020/04/12/7c4f45c8402dcd6980a18a033766ca7b.png",
    }, ],
    config: {
      showfoot: true
    },
    zanshang2: 'http://bmobfile.twho.top/2020/04/02/e46dc26e407c0014804144a3b7408293.png',
    zanshang: 'http://bmobfile.twho.top/2020/04/02/b47e8c0740a8c128807d995092a46023.jpeg',
    unitId: 'adunit-f49cb34a7d9564a2'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  showImg() {
    var n = this;
    wx.previewImage({
      current: n.data.zanshang,
      urls: [n.data.zanshang]
    });
  },
  showuser() {

    var str = "wx号:aliaosha2",
    num = 'aliaosha2';
    console.log("show")
    wx.showModal({
      title: "请添加:",
      content: str + "",
      showCancel: !1,
      success: function (res) {
        console.log(res)
        wx.setClipboardData({
          data: num,
          success: function () {
            wx.showToast({
              title: '复制成功',
            })
          }
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    console.log(app.config)
    var msg = app.config.app_title ? app.config.app_title : '客服服务';
    this.setData({
      msg: msg
    })
    if (app.config.ad) {
      this.setData({
        unitId: app.config.ad
      })
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
  jinqun(e) {
    console.log(e)
    let that = this;
    let appid = e.currentTarget.dataset.appid;
    var path = e.currentTarget.dataset.path;
    if (!path) {
      path = 'pages/index/index'
    }
    if (!appid) {
      return
    }
    wx.navigateToMiniProgram({
      appId: appid,
      path: path
    })

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: "分享",
      path: "/pages/index/index",
      success: function (t) {

      }
    }
  }
})